
//
//  AuthenticateControl.m
//  WE
//
//  Created by iMacOne on 15/11/30.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "AuthenticateControl.h"
#import "Size.h"
#import <Masonry.h>
#import "ToolUtil.h"
@interface AuthenticateControl ()

@end

@implementation AuthenticateControl
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"实名认证";
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatView];
}
- (void)creatView
{
    UILabel * lbl = [UILabel new];
    [self.view addSubview:lbl];
    //    lbl.backgroundColor = DEBUG_CLOLR;
    lbl.text = @"为了给您提供更好的服务, 需要账号实名认证 请务必填写真实信息, 您的信息我们将严格保密!";
    lbl.font = FONT(14);
    lbl.backgroundColor = GRAYCOLOR;
    lbl.numberOfLines = 2;
    lbl.textColor = [UIColor grayColor];
    //    lbl.textAlignment = NSTextAlignmentCenter;
    [lbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(120);
        make.centerX.equalTo(self.view);
        make.width.offset(300);
    }];
    
    UILabel * lbl1 = [UILabel new];
    [self.view addSubview:lbl1];
    lbl1.text = @"账号: 13458997454 ";
    lbl1.font = FONT(14);
    [lbl1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl.mas_bottom).with.offset(20);
        make.left.offset(20);
        make.size.mas_equalTo(CGSizeMake(150, 20));
        
    }];
    UIView * aView = [UIView new];
    [self.view addSubview:aView];
    aView.backgroundColor = GRAYCOLOR;
    [aView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl1.mas_bottom).offset(5);
        make.size.mas_equalTo(CGSizeMake(WindowWidth, 1));
    }];
    
    UILabel * lbl2 = [UILabel new];
    [self.view addSubview:lbl2];
    lbl2.text = @"姓名:";
    lbl2.font = FONT(14);
    [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl1.mas_bottom).with.offset(20);
        make.left.equalTo(lbl1.mas_left);
        make.size.mas_equalTo(CGSizeMake(50, 20));
    }];
    UITextField * TF = [UITextField new];
    [self.view addSubview:TF];
    TF.placeholder = @"请输入真实姓名, 认证后不可修改";
    TF.font = FONT(14);
    
//    TF.borderStyle = UITextBorderStyleRoundedRect;
    [TF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl2.mas_top);
        make.left.equalTo(lbl2.mas_right).offset(10);
        make.height.offset(20);
        
    }];
    
    UIView * bView = [UIView new];
    [self.view addSubview:bView];
    bView.backgroundColor = GRAYCOLOR;
    [bView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lbl2.mas_bottom).offset(5);
        make.size.mas_equalTo(CGSizeMake(WindowWidth, 1));
    }];

    UIButton * btn = [UIButton new];
    [self.view addSubview:btn];
    btn.backgroundColor = [UIColor blueColor];
    btn.layer.masksToBounds = YES;
    btn.layer.cornerRadius = 2;
    btn.tag = 120;
    [btn setTitle:@"提交" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(doClick:) forControlEvents:UIControlEventTouchUpInside];
    btn.titleLabel.font = FONT(14);
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(bView.mas_bottom).offset(60);
        make.left.equalTo(self.view).with.offset(10);
        make.centerX.equalTo(self.view);
        make.height.offset(40);
    }];
    
    UIButton * btn1 = [UIButton new];
    [self.view addSubview:btn1];
    btn1.backgroundColor = [UIColor whiteColor];
    btn1.tag = 121;
    btn1.layer.masksToBounds = YES;
    btn1.layer.cornerRadius = 2;
    btn1.layer.borderWidth = 1;
    btn1.layer.borderColor = [UIColor grayColor].CGColor;
    [btn1 setTitle:@"稍后认证" forState:UIControlStateNormal];
    [btn1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn1 addTarget:self action:@selector(doClick:) forControlEvents:UIControlEventTouchUpInside];
    btn1.titleLabel.font = FONT(14);
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(btn.mas_bottom).offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.centerX.equalTo(self.view);
        make.height.offset(40);
    }];


    
}
- (void)doClick:(UIButton *)btn
{
    if (btn.tag == 120) {
        
    }else if (btn.tag == 121){
        [self.navigationController popViewControllerAnimated:YES];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
